home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / gemfsc20 / gemfsc20.lzh / GNUGEM27 / VDIESC1.C < prev    next >
C/C++ Source or Header  |  1993-03-24  |  17KB  |  688 lines

  1. /* vdiesc1.c - vdi - escapes missing from GEMLIB            */
  2. /* Reference:    Atari ST Profibuch                    */
  3. /*        Hans-Dieter Jankowski, Julian F. Reschke, Dietmar Rabich */
  4. /*        SYBEX-Verlag GmbH, Düsseldorf, Germany            */
  5. /*        7.th edition 1989                    */
  6. /*        ISBN : 3-88745-563-0                    */
  7. /*        Pages 413 ff.                        */
  8.  
  9. /* Thomas Koenig (UI0T@DKAUNI2.BITNET, UI0T@IBM3090.RZ.UNI-KARLSRUHE.DE) */
  10. /* This file is put into the public domain                */
  11. /* Notice that, on the ST, some of these calls require GDOS.        */
  12.  
  13. #include <stddef.h>
  14. #include "common.h"
  15. #include <vdibind.h>
  16.  
  17. #ifdef __DEF_ALL__
  18.  
  19. #define L_vq_tabst
  20. #define L_v_hardco
  21. #define L_v_dspcur
  22. #define L_v_rmcur
  23. #define L_v_form_a
  24. #define L_v_output
  25. #define L_v_clear_
  26. #define L_v_bit_im
  27. #define L_vq_scan
  28. #define L_v_alpha_
  29. #define L_vs_palet
  30. #define L_v_sound
  31. #define L_vs_mute
  32. #define L_vt_resol
  33. #define L_vt_axis
  34. #define L_vt_origi
  35. #define L_vq_dimen
  36. #define L_vt_align
  37. #define L_vsp_film
  38. #define L_vqp_film
  39. #define L_vsc_expo
  40. #define L_v_meta_e
  41. #define L_v_write_
  42. #define L_vm_pages
  43. #define L_vm_coord
  44. #define L_vm_filen
  45. #define L_v_escape
  46.  
  47. #endif /* __DEF_ALL__ */
  48.  
  49.  
  50. #ifdef L_vq_tabst
  51.  
  52. /*        vq_tabstatus                        */
  53. /*        screen escape                        */
  54. /* INQUIRE TABLET STATUS                        */
  55. /* Inquiere wether a grapics tablet, a mouse, a Joystick or of something */
  56. /* like that.                                */
  57.  
  58. int vq_tabstatus(int handle)
  59. {
  60.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 16), handle);
  61.     return _intout[0];
  62. }
  63. #endif /* L_vq_tabst */
  64.  
  65.  
  66. /*        v_hardcopy                        */
  67. /*        screen escape                        */
  68. /* HARD COPY                                */
  69. /* Make a hard copy of the screen.                    */
  70.  
  71. #ifdef L_v_hardco
  72.  
  73. void v_hardcopy(int handle)
  74. {
  75.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 17), handle);
  76. }
  77. #endif /* L_v_hardco */
  78.  
  79.  
  80. /*        v_dspcur                        */
  81. /*        screen escape                        */
  82. /* PLACE GRAPHICS CURSOR AT LOCATION                    */
  83. /* Place the grapics cursor at the specified location.            */
  84.  
  85. #ifdef L_v_dspcur
  86.  
  87. void v_dspcur (int handle, int x, int y)
  88. /* Parameters:                                */
  89. /*    x: x - coordinate of new graphics cursor position        */
  90. /*    y: y - coordinate of new graphics cursor position        */
  91.  
  92. {
  93.     _ptsin[0] = x;
  94.     _ptsin[1] = y;
  95.     __vdi__(VDI_CONTRL_ENCODE(5, 1, 0, 18), handle);
  96. }
  97. #endif /* L_v_dspcur */
  98.  
  99. /*        v_rmcur                         */
  100. /*        screen escape                        */
  101. /* REMOVE LAST GRAPHICS CURSOR                        */
  102. /* Removes the last grapics cursor.                 */
  103.  
  104. #ifdef L_v_rmcur
  105.  
  106. void v_rmcur(int handle)
  107. {
  108.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 19), handle);
  109. }
  110. #endif /* L_v_rmcur */
  111.  
  112. /*        v_form_adv                        */
  113. /*        printer escape                        */
  114. /* FORM ADVANCE                             */
  115. /* form feed to printer, do not erase printer buffer            */
  116.  
  117. #ifdef L_v_form_a
  118.  
  119. void v_form_adv(int handle)
  120. {
  121.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 20), handle);
  122. }
  123. #endif /* L_v_form_a */
  124.  
  125.  
  126. /*        v_output_window                     */
  127. /*        printer escape                        */
  128. /* OUTPUT WINDOW                            */
  129. /* output part of the screen to printer, delimited by 2 points        */
  130.  
  131. #ifdef L_v_output
  132.  
  133. void v_output_window(int handle, int *pxyarray)
  134. /* Parameters:                                */
  135. /*    pxyarray[0] : x - coordinate of a corner of the ouptut window    */
  136. /*    pxyarray[1] : y - coordinate of ...             */
  137. /*    pxyarray[2] : x - coordinate of other corner of the window    */
  138. /*    pxyarray[3] : y - coordinate of ...             */
  139. {
  140. #ifdef __MSHORT__    /* we have 16 bit ints, just change vdi params */
  141.     _vdiparams[2] = (void *) &pxyarray[0];
  142. #else            /* 32 bit ints - let's copy */
  143.  
  144.     _ptsin[0] = pxyarray[0];
  145.     _ptsin[1] = pxyarray[1];
  146.     _ptsin[2] = pxyarray[2];
  147.     _ptsin[3] = pxyarray[3];
  148.  
  149. #endif
  150.  
  151.     __vdi__(VDI_CONTRL_ENCODE(5, 2, 0, 21), handle);
  152.  
  153. #ifdef __MSHORT__
  154.     _vdiparams[2] = (void *)&_ptsin[0]; /* restore vdi parameters */
  155. #endif
  156. }
  157. #endif /* L_v_output */
  158.  
  159. /*        v_clear_disp_list                    */
  160. /*        printer escape                        */
  161. /* CLEAR DISPLAY LIST                            */
  162. /* clear printer buffer, no form feed                    */
  163.  
  164. #ifdef L_v_clear_
  165.  
  166. void v_clear_disp_list(int handle)
  167. {
  168.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 22), handle);
  169. }
  170. #endif /* L_v_clear_ */
  171.  
  172.  
  173. /*        v_bit_image                     */
  174. /*        printer escape                        */
  175. /* OUTPUT BIT IMAGE FILE                        */
  176. /* output a bit image file (*.IMG) to a printer             */
  177.  
  178. #ifdef L_v_bit_im
  179.  
  180. void v_bit_image(int handle, const char *filename, int aspect, int x_scale,
  181.             int y_scale, int h_align, int v_align,
  182.             int *pxyarray)
  183. /* Parameter:                                */
  184. /*    aspect: =0 aspect ratio is ignored                */
  185. /*        =1 use aspect ratio (circles -> circles)        */
  186. /*    x_scale: scaling of the x - axis,    =0 : fractional     */
  187. /*                        =1 : whole number    */
  188. /*    y_scale: scaling of the y - axis, see x_axis            */
  189. /*    h_align: horizontal alignment, 0 = left, 1 = center, 2= right    */
  190. /*    v_align: vertical alignment, 0 = upper edge, 1 = center,    */
  191. /*                2 = lower edge                */
  192. /*    pxyarray[0], [1] : possible coordinates of upper left corner of */
  193. /*        the output area                     */
  194. /*    pxyarray[2], [3] : possible coordinates of lower right corner of */
  195. /*        the output area                     */
  196.  
  197. {
  198.     register short *ptmp;
  199.     short n;
  200.  
  201. #ifdef __MSHORT__    /* we have 16 bit ints, just change vdi params */
  202.     _vdiparams[2] = (void *) &pxyarray[0];
  203. #else            /* 32 bit ints - let's copy */
  204.  
  205.     _ptsin[0] = pxyarray[0];
  206.     _ptsin[1] = pxyarray[1];
  207.     _ptsin[2] = pxyarray[2];
  208.     _ptsin[3] = pxyarray[3];
  209.  
  210. #endif
  211.  
  212.     _intin[0] = aspect;
  213.     _intin[1] = x_scale;
  214.     _intin[2] = y_scale;
  215.     _intin[3] = h_align;
  216.     _intin[4] = v_align;
  217.  
  218. /* copy the file name */
  219.     ptmp = _intin + 5;
  220.     while( *ptmp ++ = (unsigned char) *filename++)
  221.         ;
  222.  
  223.     n = (ptmp - _intin) -1;
  224.  
  225.     __vdi__(VDI_CONTRL_ENCODE(5, 2, n, 23), handle);
  226.  
  227. #ifdef __MSHORT__
  228.     _vdiparams[2] = (void *)&_ptsin[0]; /* restore vdi parameters */
  229. #endif
  230. }
  231. #endif /* L_v_bit_im */
  232.  
  233.  
  234. /*        vq_scan                         */
  235. /*        printer escape                        */
  236. /* INQUIRE PRINTER SCAN                         */
  237. /* inquires different printer parameters                */
  238.  
  239. #ifdef L_vq_scan
  240.  
  241. void vq_scan(int handle, int *g_slice, int *g_page, int *a_slice,
  242.         int *a_page, int *div_fac)
  243. /* Parameters:                                */
  244. /*    *g_slice: The printer driver subdivides the page into several    */
  245. /*        'slices', which are formatted and output one after the  */
  246. /*        other to save memory; this is their number.     */
  247. /*    *g_page: number of pixels on a slice                */
  248. /*    *a_slice: height of a text line in pixels            */
  249. /*    *a_page: number of text lines per page                */
  250. /*    *div_fac: the other values have to be divided by this factor    */
  251.  
  252. {
  253.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 24), handle);
  254.  
  255.     *g_slice = _intout[0];
  256.     *g_page  = _intout[1];
  257.     *a_slice = _intout[2];
  258.     *a_page  = _intout[3];
  259.     *div_fac = _intout[4];
  260. }
  261. #endif /* L_vq_scan */
  262.  
  263. /*        v_alpha_text                        */
  264. /*        printer escape                        */
  265. /* OUTPUT ALPHA TEXT                            */
  266. /* output text to printer (not in graphics mode), with certain control    */
  267. /* codes.                                */
  268.  
  269. #ifdef L_v_alpha_
  270.  
  271. void v_alpha_text(int handle, const char *string)
  272. /* Parameters:                                */
  273. /*    *string: pointer to string, which may contain the        */
  274. /*        following control sequences:                */
  275. /*            DC2 0:    bold type on                */
  276. /*            DC2 1:    bold type off                */
  277. /*            DC2 2:    slanted type on             */
  278. /*            DC2 3:    slanted type off            */
  279. /*            DC2 4:    underscore on                */
  280. /*            DC2 5:    underscore off                */
  281. /*        (DC2 is ASCII Nr. 18 = \022)                */
  282.  
  283. {
  284.     short n;
  285.     short *ptmp = _intin;
  286.  
  287.     while (*ptmp++ = (unsigned char) *string++)
  288.         ;
  289.  
  290.     n = (ptmp - _intin) -1;
  291.  
  292.     __vdi__(VDI_CONTRL_ENCODE(5, 0, n, 25), handle);
  293.  
  294. }
  295. #endif /* L_v_alpha_ */
  296.  
  297.  
  298. /*        vs_palette                        */
  299. /*        IBM CGA escape                        */
  300. /* SELECT PALETTE                            */
  301. /* selects a colour palette for IBM CGA grapics card in medium resolution */
  302.  
  303. #ifdef L_vs_palet
  304.  
  305. int vs_palette( int handle, int palette)
  306. {
  307.     _intin[0] = palette;
  308.  
  309.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 1, 60), handle);
  310.  
  311.     return _intout[0];
  312. }
  313. #endif /* L_vs_palet */
  314.  
  315.  
  316. /*        v_sound                         */
  317. /*        screen escape                        */
  318. /* GENERATE SPECIFIED TONE                        */
  319. /* generates a tone of specified length and frequency.            */
  320.  
  321. #ifdef L_v_sound
  322.  
  323. void v_sound(int handle, int frequency, int duration)
  324. /* Parameters:                                */
  325. /*    frequency: Frequency of the tone in Hertz            */
  326. /*    duration: length of tone in timer ticks             */
  327. {
  328.     _intin[0] = frequency;
  329.     _intin[1] = duration;
  330.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 2, 61), handle);
  331. }
  332. #endif /* L_v_sound */
  333.  
  334.  
  335. /*        vs_mute                         */
  336. /*        screen escape                        */
  337. /* SET/CLEAR TONE MUTING FLAG                        */
  338. /* sets or clears the tone muting flag or reports its status        */
  339.  
  340. #ifdef L_vs_mute
  341.  
  342. int vs_mute(int handle, int action)
  343. /* Parameter: action : -1    inquire status                */
  344. /*            0    switch on sound             */
  345. /*            1    switch off sound            */
  346. /* return value: 0 : sound on                        */
  347. /*         1 : sound off                        */
  348. {
  349.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 1, 62), handle);
  350.     return _intout[0];
  351. }
  352. #endif /* L_vs_mute */
  353.  
  354.  
  355. /*        vt_resolution                        */
  356. /*        graphic tablet escape                    */
  357. /* SET TABLET AXIS RESOLUTION IN LINES/INCH             */
  358. /* set horizontal and vertical resolution of a grapichs tablet        */
  359.  
  360. #ifdef L_vt_resol
  361.  
  362. void vt_resolution( int handle, int xres, int yres, int *xset, int *yset)
  363. /* Parameters:                                */
  364. /*    xres, yres: resolution in lines per inch            */
  365. /*    *xset, *yset: the resolution set                */
  366. {
  367.     _intin[0] = xres;
  368.     _intin[1] = yres;
  369.  
  370.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 2, 81), handle);
  371.  
  372.     *xset = _intout[0];
  373.     *yset = _intout[1];
  374. }
  375. #endif /* L_vt_resol */
  376.  
  377.  
  378. /*        vt_axis                         */
  379. /*        graphic tablet escape                    */
  380. /* SET TABLET AXIS RESOLUTION IN LINES                    */
  381. /* sets the horizontal and vertical resolution of the grapics tablet    */
  382.  
  383. #ifdef L_vt_axis
  384.  
  385. void vt_axis(int handle, int xres, int yres, int *xset, int *yset)
  386. /* Parameters:                                */
  387. /*    xres, yres: resolution in lines                 */
  388. /*    *xset, *yset: the resolution set                */
  389. {
  390.     _intin[0] = xres;
  391.     _intin[1] = yres;
  392.  
  393.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 2, 82), handle);
  394.  
  395.     *xset = _intout[0];
  396.     *yset = _intout[1];
  397. }
  398. #endif /* L_vt_axis */
  399.  
  400.  
  401. /*        vt_origin                        */
  402. /*        graphics tablet escape                    */
  403. /* SET TABLET X AND Y ORIGIN                        */
  404. /* sets tablet origin.                            */
  405.  
  406. #ifdef L_vt_origi
  407.  
  408. void vt_origin(int handle, int xorigin, int yorigin)
  409. /* Parameters:                                */
  410. /*    xorigin: x - coordinate for the left upper corner        */
  411. /*    yorigin: y - coordinate for the left upper corner        */
  412. {
  413.     _intin[0] = xorigin;
  414.     _intin[1] = yorigin;
  415.  
  416.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 2, 83), handle);
  417. }
  418. #endif /* L_vt_origi */
  419.  
  420.  
  421. /*        vt_tdimensions                        */
  422. /*        graphics tablet escape                    */
  423. /* RETURN TABLET X AND Y DIMENSIONS                 */
  424. /* returns the grapics tablet's dimensions in 1/10 inch         */
  425.  
  426. #ifdef L_vq_dimen
  427.  
  428. void vq_dimensions(int handle, int *xdimension, int *ydimension)
  429. /* Parameters: you can guess, can't you?                */
  430. {
  431.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 0, 84), handle);
  432.  
  433.     *xdimension = _intout[0];
  434.     *ydimension = _intout[1];
  435. }
  436. #endif /* L_vq_dimen */
  437.  
  438.  
  439. /*        vt_alignment                        */
  440. /*        graphics tablet escape                    */
  441. /* SET TABLET ALIGNMENT                         */
  442.  
  443. #ifdef L_vt_align
  444.  
  445. void vt_alignment(int handle, int dx, int dy)
  446. /* Parameters: dx, dy : offsets for X- and Y - coordinate from origin    */
  447.  
  448. {
  449.     _intin[0] = dx;
  450.     _intin[1] = dy;
  451.  
  452.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 2, 85), handle);
  453. }
  454. #endif /* L_vt_align */
  455.  
  456.  
  457. /*        vsp_film                        */
  458. /*        polaroid palette escape                 */
  459. /* SET CAMERA FILM TYPE AND EXPOSURE TIME                */
  460. /* just what it says...                         */
  461.  
  462. #ifdef L_vsp_film
  463.  
  464. void vsp_film(int handle, int index, int lightness)
  465. /* Parameters:                                */
  466. /*    index: number of film type                    */
  467. /*    lightness: exposure time from -3 (half) to 0 (normal) to +3 (double) */
  468. {
  469.     _intin[0] = index;
  470.     _intin[1] = lightness;
  471.  
  472.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 2, 91), handle);
  473. }
  474. #endif /* L_vsp_film */
  475.  
  476.  
  477. /*        vqp_filmname                        */
  478. /*        polaroid palette escape                 */
  479. /* INQUIRE CAMERA FILM NAME                     */
  480. /* returns the name of a film, given its index, or the null string if    */
  481. /* it does not exist, with a maximum of 24 characters.            */
  482.  
  483. #ifdef L_vqp_film
  484.  
  485. int vqp_filmname(int handle, int index, char *name)
  486. /* Parameters:                                */
  487. /*    index: Index of the film type                    */
  488. /*    *name: name of the film type                    */
  489. /* return value: 0: wrong number of film                */
  490. {
  491.     short tmp, res;
  492.     short *ptmp;
  493.  
  494.     _intin[0] = index;
  495.  
  496.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 1, 92), handle);
  497.  
  498.     ptmp = _intout;
  499.     res = _contrl[4];
  500.     for (tmp = 0; tmp < res; tmp++)
  501.         *name++ = *ptmp++;
  502.  
  503.     return res;
  504. }
  505. #endif /* L_vqp_film */
  506.  
  507.  
  508. /*        vsc_expose(handle, state)                */
  509. /*        polaroid palette escape                 */
  510. /* DISABLE OR ENABLE FILM EXPOSURE FOR FRAME PREVIEW            */
  511. /* ...                                    */
  512.  
  513. #ifdef L_vsc_expo
  514.  
  515. void vsc_expose(int handle, int state)
  516. /* Parameters:                                */
  517. /*    state:    = 0: switch off exposure                */
  518. /*        != 0: switch on exposure                */
  519. {
  520.     _intin[0] = state;
  521.  
  522.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 1, 93), handle);
  523. }
  524. #endif /* L_vsc_expo */
  525.  
  526.  
  527. /*        v_meta_extents                        */
  528. /*        metafile escape                     */
  529. /* UPDATE METAFILE EXTENTS                        */
  530. /* all the information in a metafile header is renewed.         */
  531.  
  532. #ifdef L_v_meta_e
  533.  
  534. void v_meta_extents(int handle, int min_x, int min_y, int max_x, int max_y)
  535. /* Parameters:                                */
  536. /*    min_x : minimum x - value of surrounding rectangle        */
  537. /*    min_y : dto., with y                        */
  538. /*    max_x : maximum y - value of surrounding rectangle        */
  539. /*    max_y : dto, with y                     */
  540. {
  541.     _ptsin[0] = min_x;
  542.     _ptsin[1] = min_y;
  543.     _ptsin[2] = max_x;
  544.     _ptsin[3] = max_y;
  545.  
  546.     __vdi__(VDI_CONTRL_ENCODE(5, 2, 0, 98), handle);
  547.  
  548. }
  549. #endif /* L_v_meta_e */
  550.  
  551.  
  552. /*        v_write_meta                        */
  553. /*        metafile escape                     */
  554. /*        WRITE METAFILE ITEM                 */
  555. /* write a user - defined opcode into a metafile. Note that opcodes */
  556. /* 0 to 100 are reserved.                        */
  557.  
  558. #ifdef L_v_write_
  559.  
  560. void v_write_meta(int handle, int num_intin, int *a_intin, int num_ptsin,
  561.             int *a_ptsin)
  562. /* parameters:                                */
  563. /*    num_intin: number of elements in the _intin - array     */
  564. /*    num_ptsin: number of elements in the _ptsin - array     */
  565. /*    a_intin[0] : user - defined sub - opcode            */
  566. /*    a_intin[1] ... a_intin[num_intin-1] : user - defined data    */
  567. /*    a_ptsin[0] ... a_ptsin[num_ptsin-1] : user - defined data    */
  568. /* GEM Draw uses the following opcodes:                 */
  569. /*    START GROUP (10)                        */
  570. /*    END GROUP (11)                            */
  571. /*    SET NO LINE STYLE (49)                        */
  572. /*    SET ATTRIBUTE SHADOW ON (50)                    */
  573. /*    SET ATTRIBUTE SHADOW OFF (51)                    */
  574. /*    START DRAW AREA PRIMITIVE (80)                    */
  575. /*    END DRAW AREA PRIMITIVE (81)                    */
  576. {
  577. #ifdef __MSHORT__    /* we have 16 bit ints, just change vdi params */
  578.     _vdiparams[1] = (void *) &a_intin[0];
  579.     _vdiparams[2] = (void *) &a_ptsin[0];
  580. #else            /* 32 bit ints - let's copy */
  581.     register int i;
  582.  
  583.     for(i = 0; i < num_intin; i++)
  584.         _intin[i] = a_intin[i];
  585.  
  586.     for(i = 0; i < num_ptsin; i++)
  587.         _ptsin[i] = a_ptsin[i];
  588. #endif
  589.  
  590.     __vdi__(VDI_CONTRL_ENCODE(5, num_ptsin, num_intin, 99), handle);
  591.  
  592. #ifdef __MSHORT__
  593.     _vdiparams[1] = (void *)&_intin[0]; /* restore vdi parameters */
  594.     _vdiparams[2] = (void *)&_ptsin[0];
  595. #endif
  596. }
  597. #endif /* L_v_write_ */
  598.  
  599.  
  600. /*        vm_pagesize                     */
  601. /*        metafile escape                     */
  602. /* PHYSICAL PAGE SIZE                            */
  603. /* set the page size in 1/10 mm                     */
  604.  
  605. #ifdef L_vm_pages
  606.  
  607. void vm_pagesize(int handle, int pgwidth, int pgheight)
  608. /* Parameters:                                */
  609. /*    pgwidth: width in 1/10 mm                    */
  610. /*    pgheight: height in 1/10 mm                 */
  611. {
  612.     _intin[0] = 0;
  613.     _intin[1] = pgwidth;
  614.     _intin[2] = pgheight;
  615.  
  616.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 3, 99), handle);
  617. }
  618. #endif /* L_vm_pages */
  619.  
  620.  
  621. /*        vm_coords                        */
  622. /*        metafile escape                     */
  623. /* COORDINAT WINDOW                         */
  624. /* sets the coordinate system for the page.             */
  625.  
  626. #ifdef L_vm_coord
  627.  
  628. void vm_coords(int handle, int llx, int lly, int urx, int ury)
  629. /* Parameters:                                */
  630. /*    llx: x - coordinate in the left lower corner            */
  631. /*    lly: y - coordinate in the left lower corner            */
  632. /*    urx: x - coordinate in the right upper corner            */
  633. /*    ury: y - coordinate in the right upper corner            */
  634. {
  635.     _intin[0] = 1;
  636.     _intin[1] = llx;
  637.     _intin[2] = lly;
  638.     _intin[3] = urx;
  639.     _intin[4] = ury;
  640.  
  641.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 5, 99), handle);
  642.  
  643. }
  644. #endif /* L_vm_coord */
  645.  
  646.  
  647. /*        vm_filename                     */
  648. /*        metafile escape                     */
  649. /* CHANGE GEM VDI FILE NAME                     */
  650. /* changes a metafile name from GEMFILE.GEM to <something esle>.GEM.    */
  651. /* Has no effect unless executed immediately after OPEN WORKSTATION.    */
  652.  
  653. #ifdef L_vm_filen
  654.  
  655. void vm_filename(int handle, const char *filename)
  656. {
  657.     short n;
  658.     register short *ptmp = _intin;
  659.  
  660. /* copy string */
  661.     while (*ptmp++ = (unsigned char) *filename++)
  662.         ;
  663.     n = (ptmp - _intin) -1;
  664.  
  665.     __vdi__(VDI_CONTRL_ENCODE(5, 0, n, 100), handle);
  666.  
  667. }
  668. #endif /* L_vm_filen */
  669.  
  670.  
  671. /*        v_escape2000                        */
  672. /*        escape for Atari SLM804                 */
  673. /* ESCAPE 2000                                */
  674. /* prints the current page several times on the SLM804            */
  675.  
  676. #ifdef L_v_escape
  677.  
  678. void v_escape2000(int handle, int times)
  679. /* Parameters:                                */
  680. /*    times: number of times to print the current page        */
  681. {
  682.         _intin[0] = times;
  683.  
  684.     __vdi__(VDI_CONTRL_ENCODE(5, 0, 1, 2000), handle);
  685.  
  686. }
  687. #endif /* L_v_escape */
  688.